<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <th:block th:include="include :: header('修改所有Worker')" />
</head>
<body class="white-bg">

  <div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-group-modify">
      <input type="hidden" name="group" th:value="${group}" />
      <div class="form-group">
        <div class="col-sm-12">
          <input type="text" name="maximumPoolSize" class="form-control" placeholder="修改该组所有Worker的线程池最大线程数" autocomplete="off" required />
        </div>
      </div>
    </form>
  </div>

  <th:block th:include="include :: footer" />
  <script th:inline="javascript">
    const prefix = ctx + "disjob/mygroup"

    $("#form-group-modify").validate({
      focusCleanup: true,
      rules: {
        maximumPoolSize: {
          digits: true,
          min: 1,
          max: 32767
        }
      }
    });

    function submitHandler() {
      if ($.validate.form()) {
        const params = $('#form-group-modify').serialize();
        $.operate.save(prefix + "/modify_all_worker_config", params, function (result) {
          if (result.code === 0) {
            const src = prefix + "/worker?group=" + [[${group}]];
            const iframe = $(window.parent.document).find("iframe[src='" + src + "']");
            iframe.attr("src", src);
          }
        });
      }
    }
  </script>

</body>
</html>
